﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RolesList.ascx.cs" Inherits="SERP.Modules.Roles.RolesList" %>
<div class="ftitle">
    <a class="ftitlelink" onclick='<%="expandCollapseSearch(\"dvsRoles\",\"imgsRoles\",\""+hsRoles.ClientID+"\",\"drdown.jpg\",\"closeup.jpg\",true);" %>'>
        <asp:HiddenField runat="server" ID="hsRoles" Value="0" />
        <img id='imgsRoles' src='<%=ResolveUrl("~/App_Themes/Default/img/drdown.jpg")%>'>
        <span id="lblTitle" runat="Server" enableviewstate="false"></span></a>
    <div class="toolbar">
        <asp:Button ID="btnHelps" runat="server" Text="Helps" OnClientClick="showHelp(window.localtion)" />
        <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="OnDelete" />
        <asp:Button ID="btnAddNew" runat="server" Text="Addnew" OnClick="OnAddNew" />
    </div>
</div>
<div class="form" id="dvsRoles" style='display:none'>
	<div class="frow"> 
	<asp:Label ID="labelRoleName" runat="server" Text="RoleName" CssClass="label"  EnableViewState="False"></asp:Label>
			<asp:TextBox runat="server" ID="txtRoleName"  Width="400"></asp:TextBox>
	</div>
	<div class="frow"> 
	<asp:Label ID="labelNote" runat="server" Text="Note" CssClass="label"  EnableViewState="False"></asp:Label>
			<asp:TextBox runat="server" ID="txtNote"  Width="400"></asp:TextBox>
	</div>
	<div class="frow"> 
	<asp:Label ID="labelRoleType" runat="server" Text="RoleType" CssClass="label"  EnableViewState="False"></asp:Label>
				<asp:TextBox runat="server" ID="txtRoleType" MaxLength="4" Width="400"></asp:TextBox>
			<asp:RegularExpressionValidator ID="validExpressionRoleType" ValidationGroup="btnSearch" runat="server" ControlToValidate="txtRoleType"
			ErrorMessage="*dữ liệu dạng số nguyên" ValidationExpression="^\d+$"></asp:RegularExpressionValidator>
	</div>
	<div class="btnbar">
			 <asp:Button ID="btnSearch" runat="server" CssClass="button" ValidationGroup="btnSearch" onclick="btnSearch_Click" 
				 Text="Tìm kiếm" Width="80px" />
	</div>
</div>
<table class="grid">
    <tr>
        <td class="tblhleft" style="width:34px">
            <input type="checkbox" id="cbkCheckAllRoles" name="cbkCheckAllRoles" onclick="SelectAllCheckboxes(this,'cbkRoles')"
                onchange="selectAllCheckboxes(this,'cbkRoles')">
        </td>
        <td class="tblh" style="width:34px">
        	<%=SERP.Constants.APP_INDEX%>
        </td>
        <td class="tblh">                    
			<%=SERP.StringMappings.RolesStringMapping.RoleName%>
        </td>
        <td class="tblh">                    
			<%=SERP.StringMappings.RolesStringMapping.Note%>
        </td>
		<td class="tblh">                    
			<%=SERP.StringMappings.RolesStringMapping.RoleType%>
        </td>
        <td class="tblh" style="width:30px;text-align:center">                    
		<%=SERP.Constants.APP_EDIT%>
		</td>
        <td class="tblh" style="width:30px;text-align:center">                    
		<%=SERP.Constants.APP_DELETE%>
		</td>
    </tr>
	<asp:Repeater runat="server" ID="gridData" >
		<ItemTemplate>
	<tr>
		<td class="tblcleft">
			<asp:CheckBox ID="cbkRoles" Runat="server"/>
		</td>
		<td class="tblc">
			<%#Container.ItemIndex+1%>
		</td>
		<td class="tblc">
			<asp:LinkButton CommandArgument='<%#string.Concat("&RoleId="+Eval("RoleId"))%>' OnCommand="btnXem_OnCommand" runat="server">     
			<%#Eval("RoleName")%>
			</asp:LinkButton>
		</td>  
		<td class="tblc">
			<asp:LinkButton CommandArgument='<%#string.Concat("&RoleId="+Eval("RoleId"))%>' OnCommand="btnXem_OnCommand" runat="server">     
			<%#Eval("Note")%>
			</asp:LinkButton>
		</td>  
		<td class="tblc">
			<asp:LinkButton CommandArgument='<%#string.Concat("&RoleId="+Eval("RoleId"))%>' OnCommand="btnXem_OnCommand" runat="server">     
			<%#Eval("RoleType")%>
			</asp:LinkButton>
		</td>
		<td class="tblc" style="text-align:center">
			<asp:LinkButton ID="btnSua" runat="server" CommandArgument='<%#string.Concat("&RoleId="+Eval("RoleId"))%>' OnCommand="btnSua_OnCommand">
				<asp:Image ID="imgEdit" runat="server" style="border: 0" ImageUrl="~/App_Themes/Default/img/edit.jpg"/>
			</asp:LinkButton>
		</td>
		<td class="tblc" style="text-align:center">
			<asp:LinkButton ID="btnXoa" runat="server" CommandArgument='<%#string.Concat("&RoleId="+Eval("RoleId"))%>' OnCommand="btnXoa_OnCommand">
				<asp:Image ID="imgDelete" runat="server" style="border: 0" ImageUrl="~/App_Themes/Default/img/delete.jpg"/>
			</asp:LinkButton>
		</td>
	</tr>
		</ItemTemplate>
	</asp:Repeater>
</table>
<% if (this.IsPostBack)
{%>
<script type="text/javascript">
    expandCollapseSearch("dvsRoles","imgsRoles","<%=hsRoles.ClientID%>","drdown.jpg","closeup.jpg",false);
</script>
<%}%>
